package com.minivision.sdktestdemo;

import android.app.Application;
import android.os.Environment;
import android.test.ApplicationTestCase;

import com.minivision.sdktestdemo.utils.LrcUtils;

import java.io.File;

/**
 * <a href="http://d.android.com/tools/testing/testing_android.html">Testing Fundamentals</a>
 */
public class ApplicationTest extends ApplicationTestCase<Application> {
    public ApplicationTest() {
        super(Application.class);
        File file = Environment.getRootDirectory();
        LrcUtils.getInstance().loadLrc(findFile(file));
    }

    public File findFile(File file) {
        if (file.getName().endsWith(".lrc")) {
            return file;
        }
        if (file.isDirectory()) {
            for (File f : file.listFiles()) {
                findFile(f);
            }
        }
        return null;
    }
}